#include<stdio.h>

int main(){
    int fun(),a,b;
    scanf("%d%d",&a,&b);
    printf("%d\n",fun(a,b));
    return 0;
}

int fun(int a,int b){
    int c;
    c=1000*(a%10)+10*(a/10)+100*(b/10)+b%10;
    return c;
}
